﻿using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;

namespace SharpAnalyzer.Utilities
{
    internal static class FieldDeclarationSyntaxExtensions
    {
        public static ISymbol GetDeclaredSymbol(this FieldDeclarationSyntax node, SemanticModel model)
        {
            return node.Declaration.Variables
                .Select(syntax => model.GetDeclaredSymbol(syntax))
                .FirstOrDefault();
        }
    }
}
